using Gateway.Common.Extensions;
using Gateway.Common.Models;
using Gateway.IRepositories;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;

namespace Gateway.SqlSugar;

public static class SqlSugarExtension
{
    public static void AddSqlSugar(this IServiceCollection service,string masterConnection, List<QueryConnectionModel> connection)
    {
        service.AddSingleton<SqlSugarDbContext>(new SqlSugarDbContext(masterConnection,connection));
        service.AddScoped<IQueryRepository, SqlSugarRepository>();
    }
}